﻿@model Tasks.UI.Models.SystemSetting.BankAccountManageModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>银行账号管理</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-impromptu.3.1.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.combobox.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <style type="text/css">
        #tb1 input, #tb2 input
        {
            width: 95%;
        }
    </style>
    <script type="text/javascript">

        //init
        $(function () {


        })

        function addRow(tbl) {
            var tr = $("#" + tbl + " tr").eq(1).clone();
            tr.show();
            tr.appendTo("#" + tbl);

            $("input", tr).val("");
        }

        function delRow(src) {
            $.Msg.confirmDelete(function () {
                var row = $(src).parent().parent();

                if ($("#tb1 tr").length == 2) {
                    $("input", row).val("");
                    return;
                }
                row.remove();
            });
        }

        function goaction(act) {
            $("#act").val(act);
            $("form").submit();
        }
        
    </script>
</head>
<body>
    @using (Html.BeginForm())
    {
        <input id="act" name="act" type="hidden" />
        <div id="container">
            <div class="navTitle">
                银行管理</div>
                 @Html.OutputMessage(Model.Message, Model.MessageType)
            <table id="tb1" class="tblStyle1" style="table-layout: fixed;">
                <thead>
                    <tr>
                        <th style="width: 200px;">
                            开户人
                        </th>
                        <th style="width: 250px;">
                            开户账号
                        </th>
                        <th style="width: 250px;">
                            开户银行
                        </th>
                        <th>
                            备注
                        </th>
                        <th style="width: 60px;">
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (BankAccount account in Model.accounts)
                    {
                        <tr>
                            <td>
                                <input name="Name" type="text" value="@account.Name" />
                                <input name="ID" type="hidden" value="@account.ID" />
                            </td>
                            <td>
                                <input name="Account" type="text" value="@account.Account" />
                            </td>
                            <td>
                                <input name="Bank" type="text" value="@account.Bank" />
                            </td>
                            <td>
                                <input name="Remark" type="text" value="@account.Remark" />
                            </td>
                            <td>
                                <img src="../../Images/icon/16x16/delete.png" onclick="delRow(this)" />
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
            <div style="padding: 4px 0px;">
                <a href="javascript:addRow('tb1')" class="button blue"><span>添加</span></a> <a href="javascript:goaction('save')"
                    class="button blue"><span>保存</span></a>
            </div>
        </div>
    }
</body>
</html>
